package com.yy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 系统页面视图
 * 
 * @author 
 * @date 
 */
@Controller
public class SysPageController {
	/**
	 * velocity视图
	 * @param url
	 * @return
	 */
	@RequestMapping("sys/{url}.html")
	public String page(@PathVariable("url") String url){
		return "sys/" + url + ".html";
	}
	/**
	 * velocity视图
	 * @param url
	 * @return
	 */
	@RequestMapping("{directory}/{url}.html")
	public String page(@PathVariable("url") String url,@PathVariable("directory") String directory){
		return directory+"/" + url + ".html";
	}
	/**
	 * velocity视图
	 * @param url
	 * @return
	 */
	@RequestMapping("{url}.html")
	public String urlPage(@PathVariable("url") String url){
		//System.out.println("-------------->"+url);
		return url + ".html";
	}
	/**
	 * ftl视图
	 * @param url
	 * @return
	 */
	@RequestMapping("{directory}/{url}.ftl")
	public ModelAndView pageftl(@PathVariable("url") String url,@PathVariable("directory") String directory){
		return new ModelAndView(directory+"/" + url);
	}
	/**
	 * ftl视图
	 * @param url
	 * @return
	 */
	@RequestMapping("{url}.ftl")
	public ModelAndView urlPageftl(@PathVariable("url") String url){
		return new ModelAndView(url);
	}
}
